/**WPI CS509 cisco Stratego Message stats reply
 * 
 */
package edu.wpi.cs509.messages.client;

import edu.wpi.cs509.representation.UserStatistics;

/**
 * This class contains the reply message for a get-statistics request.
 * @author sparadis
 *
 */
public class MsgStatsReply extends MsgClientContext {

	/**
	 * serializable version number
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * The requested user statistics.
	 */
	protected UserStatistics userStats;
	
	/**
	 * The rank for these user statistics
	 */
	protected int rank;

	/**
	 * Constructor.
	 * @param userStats  statistics for the specified user.
	 * @param r rank of this user
	 */
	public MsgStatsReply(UserStatistics userStats, int r) {
		this.userStats = userStats;
		this.rank = r;
	}
	
	/**
	 * @see edu.wpi.cs509.messages.MsgBc#rxExecute()
	 * Return the statistics.
	 */
	@Override
	public void rxExecute() {
		getCl().receivePersonalStats(userStats, rank);
	}
}
